<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<html>
<head>
    <meta charset="utf-8">
    <title>查询结果</title>
    <meta name="renderer" content="webkit">
    <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
    <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1">
    <link rel="stylesheet" href="layui/css/layui.css" media="all">
    <!-- 注意：如果你直接复制所有代码到本地，上述css路径需要改成你本地的 -->
</head>
<body>
<fieldset class="layui-elem-field layui-field-title" style="margin-top: 20px;">
    <legend>查询结果</legend>
</fieldset>

<div class="layui-form">
    <table class="layui-table">
        <colgroup>
            <col width="150">
            <col width="150">
            <col width="200">
            <col>
        </colgroup>
        <thead>
        <tr>
            <th>ISBN</th>
            <th>书名</th>
            <th>作者</th>
            <th>出版社</th>
            <th>点击编辑</th>
            <th>点击删除</th>
        </tr>
        </thead>
        <tbody>
        <c:forEach var="book" items="${requestScope.book}">
            <tr>
                <td>${book.ISBN}</td>
                <td>${book.name}</td>
                <td>${book.author}</td>
                <td>${book.press}</td>
                <td>
                    <form action="edit.jsp" method="post"><%--此表单提交到编辑图书信息的jsp中 --%>
                        <button type="submit" class="layui-btn layui-btn-danger layui-btn-sm" lay-submit=""
                                lay-filter="demo1" name="edit" value="${book.ISBN}">编辑
                        </button>
                    </form>
                </td>
                <td>
                    <form action="deleteServlet.do" method="post"><%--此表单提交到删除图书信息的deleteServlet中 --%>
                        <button type="submit" class="layui-btn layui-btn-danger layui-btn-sm" lay-submit=""
                                lay-filter="demo1" name="edit" value="${book.ISBN}">删除
                        </button>
                    </form>
                </td>
            </tr>
        </c:forEach>
        </tbody>
    </table>
</div>

<fieldset class="layui-elem-field site-demo-button" style="margin-top: 30px;">
    <div>
        <a href="add.jsp">
            <button type="button" class="layui-btn layui-btn-normal">点击添加图书信息</button>
        </a>
        <a href="search.jsp">
            <button type="button" class="layui-btn layui-btn-warm">点击重新查询</button>
        </a>
    </div>
</fieldset>

</body>
</html>
